<template>
	<view class="bigBox">
		<u-navbar :autoBack="true" bgColor='#000' height='60'>
			<view class="u-nav-slot left" slot='left'>
				<u-icon name="arrow-left-double" size="28rpx" color='#fff'></u-icon>
				<text>返回登录</text>
			</view>
		</u-navbar>

		<view class="swiper-item">
			<view class="userTitle">
				<u-icon name='account' color="#000" size="24"></u-icon>
				<text class="text">手机号</text>
			</view>
			<view class="userInput">
				<u-input style='height: 80rpx;font-size: 60rpx;' placeholder="请输入手机号"></u-input>
			</view>
			<view class="userTitle">
				<u-icon name='integral' color="#000" size="24"></u-icon>
				<text class="text">验证码</text>
			</view>
			<view class="codeInput">
				<u-input style='width: 300rpx;height: 80rpx;font-size: 60rpx;'
					placeholder="验证码"></u-input>
				<view class="code">
					<u-code :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-code>
					<u-button @tap="getCode" color='#1684FC' style='height: 100rpx;'>{{tips}}</u-button>
				</view>
			</view>
			<view class="userTitle">
				<u-icon name='lock' color="#000" size="24"></u-icon>
				<text class="text">密码</text>
			</view>
			<view class="userInput">
				<u-input style='height: 80rpx;font-size: 60rpx;' type='password' password placeholder="请输入密码"></u-input>
			</view>
			<view class="userTitle">
				<u-icon name='lock' color="#000" size="24"></u-icon>
				<text class="text">再次确认密码</text>
			</view>
			<view class="userInput">
				<u-input style='height: 80rpx;font-size: 60rpx;' type='password' password placeholder="请再次输入密码"></u-input>
			</view>
			<view class="bottom">
				<view class="loginbtn">
					立 即 找 回
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tips: '',
				seconds: 60,
			}
		},
		onLoad() {
			// this.getPhoneNumber()
		},
		methods: {
			
			codeChange(text) {
				this.tips = text;
			},
			getCode() {
				if (this.$refs.uCode.canGetCode) {
					// 模拟向后端请求验证码
					uni.showLoading({
						title: '正在获取验证码'
					})
					setTimeout(() => {
						uni.hideLoading();
						// 这里此提示会被this.start()方法中的提示覆盖
						uni.$u.toast('验证码已发送');
						// 通知验证码组件内部开始倒计时
						this.$refs.uCode.start();
					}, 2000);
				} else {
					uni.$u.toast('倒计时结束后再发送');
				}
			},
			end() {
				uni.$u.toast('倒计时结束');
			},
			start() {
				uni.$u.toast('倒计时开始');
			}
		}
	}
</script>

<style>
	.bigBox {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.left {
		display: flex;
		align-items: center;
		font-size: 28rpx;
		color: #fff;
	}
	.bottom {
		margin-top: 60rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.loginbtn {
		width: 670rpx;
		height: 100rpx;
		line-height: 100rpx;
		border-radius: 8rpx;
		background-color: #1684FC;
		color: rgba(255, 255, 255, 100);
		font-size: 36rpx;
		text-align: center;
		font-family: Arial;
		border: 2rpx solid rgba(33, 51, 255, 100);
	}

	.swiper-item {
		margin-top: 300rpx;
		width: 750rpx;
		height: 800rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-around;
	}
</style>
<style lang="less">
	.userTitle {
		width: 620rpx;
		display: flex;
		align-items: center;
		text:nth-child(2) {
			margin-left: 20rpx;
			color: #BEC7D1;
			font-size: 28rpx;
		}
	}

	.userInput {
		width: 620rpx;
	}

	.codeInput {
		width: 620rpx;
		// margin-bottom: 60rpx;
		display: flex;

		.code {
			width: 300rpx;
			margin-left: 20rpx;
		}
	}

	.wjPass {
		width: 620rpx;
		display: flex;
		justify-content: flex-end;

		text {
			color: #BEC7D1;
		}
	}
</style>
